from selenium.webdriver.common.by import By

class AdminPUUserOrgLocator:

     paltform_user_tab=(By.XPATH,"//div[contains(@data-menu-id,'MANAGEMENT_PLT_PLATFORM_USER')]/span/div")

     org_tab=(By.XPATH,"//li[contains(@data-menu-id,'ORGANIZATION_PLATFORM_USER')]/span/div")

     # 增加下级按钮
     add_sub_deparment = (By.XPATH, "//button[contains(@class,'user-primary-button')]")

     # 新增子部门名称
     sub_deparment_name = (By.ID, 'creForm_name')

     # 新增子部门确认按钮
     confirm_add_sub_department = (By.XPATH, "//button[contains(@class,'orgDrawerButtonOk')]")

     # 新增子部门成功提
     add_success_prompt = (By.XPATH, "//div[contains(@class,'antd4-message-success')]")

     # 加载转菊花
     loading_wait = (By.CSS_SELECTOR, '[class="antd4-spin-dot antd4-spin-dot-spin"]')

     # 组织名称查询输入框
     organization_query_input = (By.CSS_SELECTOR, '[placeholder="Search"]')

     # 查询组织名称
     organization_query_button = (By.XPATH, "(//button[contains(@class,'search-button')])[1]")

     # 新增子部分名称
     sub_department_name = (By.XPATH, "//span[@title and contains(@class, 'antd4-tree-node-content-wrapper')]")

     # 组织名称
     org_right_name = (By.XPATH, "//div[contains(@class,'BKxwM')]")

     # 不存在的组织名称
     non_existent_organization_name = (By.XPATH, "//div[contains(@class,'orgRightName')]")

     # action下拉列表
     action_list = (By.XPATH, "//button[contains(@class,'dropdown-trigger')]")

     # delete删除
     action_delete = (By.XPATH, "//li[contains(@data-menu-id,'delete')]/span")

     # 删除确认
     action_delete_confirm = (By.XPATH, "//div[contains(@class,'modal-confirm-btns')]/button[2]")

     # 删除成功提示
     delete_success_prompt = (By.XPATH, "//span[contains(@class,'anticon-check-circle')]")

     # 组织成员查询框
     immediate_member_search_input = (By.ID, 'creForm_searchVal')

     # 查询组织名称
     immediate_member_query_button = (By.CSS_SELECTOR, '[id="creForm_searchVal"]+span>button')

     # 成员的email
     immediate_email = (By.XPATH, "//button[contains(@class,'emailName')]")

     # 筛选按钮
     filter = (By.XPATH, "//span[contains(@class,'table-filter-trigger')]/span")

     # 筛选项_normal
     filter_normal = (By.XPATH, '(//input[@class="antd4-checkbox-input"])[1]')

     # 确认选择项
     filter_ok = (By.XPATH, "//button[contains(@class,'btn-primary antd4-btn')]")

     # 状态
     filter_status = (By.XPATH, "//span[contains(@class,'badge-status-text')]")

     # edit_role
     def get_edit_org_user_role(self, role_name):
          role_ele = (By.CSS_SELECTOR, '[title="%s"]' % role_name)
          return role_ele

     #org_member_actions_tab
     org_member_actions_tab=(By.CSS_SELECTOR,'[class="anticon anticon-ellipsis table-operation-ellipsis"]')

     #actions
     actions=(By.CSS_SELECTOR,'[class="antd4-dropdown-menu-title-content"]')

     #delete_org_ack
     delete_org_ack=(By.XPATH,'//div[@role="dialog"]//input/..')

     #member_delete_confirm
     member_delete_confirm=(By.XPATH,"//div[contains(@class,'modal-footer')]/button[2]")

     # reset_pwd
     reset_pwd = (By.XPATH, '//button[contains(@class,"table-operation-btnLine-btn")]')

     # change password send
     change_pwd_send = (By.XPATH, "//button[contains(@class,'background-ghost')]")

     # change password_verification code_input
     change_password_verificationcode_input = (By.ID, 'creForm_verifyCode')

     # new_pwd
     new_pwd = (By.CSS_SELECTOR, '[autocomplete="new-password"]')

     # confirm_new_pwd
     confirm_new_pwd = (By.CSS_SELECTOR, '[id="creForm_confirmPassword"]')

     # reset_pwd_ok
     reset_pwd_ok = (By.XPATH, "(//button[contains(@class,'antd4-btn-primary')])[3]")

     # operation_button
     operation_button = (By.XPATH, '//span[contains(@class,"table-operation")]')

     # operations
     operation_type = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]')

     # edit_org_select
     edit_org_select = (By.XPATH, "//div[contains(@class,'control-input-content')]/div")

     # 编辑组织下拉框搜索
     edit_org_input = (By.CSS_SELECTOR, '[id="creForm_orgCode"]')

     # 默认组织选择
     edit_org_to_default = (By.CSS_SELECTOR, '[class="antd4-select-tree-title"]')

     # 编辑组织确认
     edit_org_confirm = (By.XPATH, "//div[contains(@class,'modal-footer')]/button[2]")

     # edit_user_group
     edit_user_group = (By.CSS_SELECTOR, '[class="antd4-select-item-option-content"]')

     # edit_org_role
     edit_org_role_select = (By.XPATH, "//div[contains(@class,'control-input-content')]/div")

     # 翻页
     page_total = (By.CSS_SELECTOR, '[class="antd4-pagination-total-text"]')

     #select_choices
     select_choices=(By.CSS_SELECTOR,'[class="antd4-select-item antd4-select-item-option"]')



     # 列表字段
     list_columns = (By.CSS_SELECTOR, "tr th.antd4-table-cell")

     # status字段
     list_column_status = (By.CSS_SELECTOR, "tr th.antd4-table-cell span.antd4-table-column-title")

     # 展开status选项
     status_checkbox = (By.CSS_SELECTOR, "tr th.antd4-table-cell span[role='button']")

     # status选项
     status_checkbox_options = (By.CSS_SELECTOR, "span.antd4-dropdown-menu-title-content>span")

     # status选项所在li
     status_choices = (By.XPATH, "//span[@class='antd4-dropdown-menu-title-content']/parent::*")

     # 确认status选择
     status_confirm = (By.XPATH, "//button[contains(@class, 'primary antd4-btn-sm')]")

     # reset status
     status_reset = (By.XPATH, "//button[contains(@class, 'link antd4-btn-sm')]")

     # reset password button
     reset_pwd_button = (By.XPATH, "//tr[contains(@class, 'antd4-table-row')]/td[6]//button")

     # 用户操作按钮
     user_options_button = (By.XPATH, "//span[contains(@class,'table-operation-ellipsis')]")

     # 展开的用户操作
     edit_organization_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[1]/span")
     edit_user_group_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[2]/span")
     edit_role_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[3]/span")
     lock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[4]/span")
     unlock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[5]/span")
     delete_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[6]/span")
     resend_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[7]/span")


     lock_area = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[4]")
     unlock_area = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[5]")

     # lock 弹窗主体
     lock_body = (By.CSS_SELECTOR, "div.antd4-modal-body")
     # lock 弹窗的接受按钮
     lock_accept = (By.CSS_SELECTOR, "span.antd4-checkbox")
     # lock 弹窗的ok按钮
     lock_confirm = (By.XPATH, "//button[@class='antd4-btn antd4-btn-primary']")


     # success_pup
     success_pup = (By.XPATH, "//div[@class='antd4-message-notice-content']//span[not(@class)]")